<?php
// no direct access
defined('_JEXEC') or die('Restricted access');

//JHtml::stylesheet(Juri::base().'templates/cashdressing/bootstrap/css/bootstrap.css');

JHtml::script($this->baseurl."/components/com_virtuemart/assets/js/cash/homejs.js");
//JHtml::script("//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js");

?>
<script>
    function step23(){//valide la demand de sac
     
     var bValid= true;
     
     /*bValid = bValid && checkRadio("croix_rouge");
     bValid = bValid && checkRadio("conditions_ventes");
     bValid = bValid && checkRadio("conditions_envoie");*/
     bValid  = bValid && (jQuery('#cguForm :checkbox:checked').length > 1);
     bValid = bValid && (jQuery('input[name=croix_rouge]:checked').val()!== '');
     if(bValid){
         jQuery("#cguForm").submit();
         return;
         //window.location.href=url;
     }else{
         alert("Vous devez cocher toutes les cases");
         return;
     }
     
 }
</script>

<div class="valider_cgu_q">
            
    <span class="text_addr">
        CONFIRMATION
    </span>  
    
    <span class="line"> 
    </span>	
    <div class="display_form">   
    <form action="index.php" method="post" id="cguForm">
        <div style="width: 100%;" >
                <div>
                    Nous n'acheterons pas les v&ecirc;tements qui ne respectent pas notre <a href="">Charte qualit&eacute;</a>. 
                    Acceptez-vous d'en faire don à la CROIX ROUGE FRANCAISE ?
                </div>
                <div>
                    <label>OUI</label>
                    <input type="radio" name="croix_rouge" id="croix_rouge_oui" value="oui"/>
                    
                </div>
                <div>
                    <label>NON</label>
                    <input type="radio" name="croix_rouge" id="croix_rouge_non" value="non"/>
                </div>
               
                     <span class="line"> 
                        </span>	
                <div><input type="checkbox" name="conditions_ventes" value="lue"/>
                    <label>J'ai lu et j'accepte <a href="">les conditions g&eacute;n&eacute;rales de vente</a>.</label>
                    
                </div>
                <div><input type="checkbox" name="conditions_envoie" value="vet"/>
                    <label>Je m'engage à n'envoyer que les v&ecirc;tements 
             
                    respectant<a href=""> la charte qualit&eacute; de CASHDRESSING</a>.</label>
                    
                </div>
        </div>
        
        <input type="hidden" name="option" value="com_cashbag"/>
        <input type="hidden" name="view" value="cashbag" />
        <input type="hidden" name="task" value="request" />
        <input type="hidden" name="layout" value="point_kiala"/>
        <input type="hidden" name="type" value="<?php echo JFactory::getApplication()->input->get("type");?>" />
        <?php  echo JHTML::_ ('form.token');?>
    </form>
        <div class="position_btn_adr">
            <button  id="precedent_cgu" class="btn_cash_green_mini">
                pr&eacute;c&eacute;dent
            </button>
            <button  id="valider_cgu" class="btn_cash_green_mini" >
                suivant
            </button>
        </div>
    </div>    
   
   
</div>

<script>
     jQuery(document).ready(function(){
         jQuery("#valider_cgu").click(function(){
              return step23();
         });
        jQuery("#precedent_cgu").click(function(){
            window.history.back();
             //var type= getURLParameter('type');
              //window.location.href='index.php?option=com_cashbag&view=cashbag&layout=editaddress&task=validate_addr&type='+type;
         });
     });
</script>